Curl提示SSL Certificate错误

在安装RVM时候报错了,curl通过https下载的时候出错。

错误描述:

Downloading RVM from wayneeseguin branch stable

curl: (60) SSL certificate problem, verify that the CA cert is OK.
Details: error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed More
details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a
"bundle" of Certificate Authority (CA) public keys (CA
certs). The default bundle is named curl-ca-bundle.crt; you can
specify an alternate file using the —cacert option. If this HTTPS
server uses a certificate signed by a CA represented in the bundle,
the certificate verification probably failed due to a problem with
the certificate (it might be expired, or the name might not match the
domain name in the URL). If you’d like to turn off curl’s
verification of the certificate, use the -k (or —insecure) option.

Could not download
https://github.com/wayneeseguin/rvm/tarball/stable‘. Make sure
your certificates are up to date as described above. To continue in
insecure mode run ‘echo insecure >> ~/.curlrc’.

经过原因查找,在验证证书的时候出现问题,是本地ssl判别证书太旧,导致报ssl证书错误

下载新的ssl本地判别文件

>> wget http://curl.haxx.se/ca/cacert.pem

并更名为ca-bundle.crt放置到默认目录

>> mv cacert.pem ca-bundle.crt  | mv ca-bundle.crt /etc/pki/tls/certs/

或者curl —cacert cacert.pem 方式指定调用